package config

import (
	"fmt"
	"github.com/spf13/viper"
)

type Mysql struct {
	Host     string
	Port     string
	User     string
	Password string
	Database string
}

type AppConfig struct {
	Mysql
}

var Config AppConfig

func InitConfig() {
	viper.SetConfigFile("../config/config.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&Config)
	fmt.Println("配置文件读取成功")
}
